<!-- Sidebar -->
<ul class="nav navbar-nav side-nav" id="navigation">
    <li class="collapsed-content">
        <!-- Collapsed content pasting here at 768px -->
    </li>
<#if userMenuList??>
    <#list userMenuList as userMenu>
        <#if userMenu.isSelected>
            <li class="dropdown open"><a onclick="saveRegister('${userMenu.menuName!''}','1');return true;"
                                         href="${absoluteContextPath}" class="dropdown-toggle" data-toggle="dropdown"
                                         title="${userMenu.menuName!''}"><i
                    class="fa fa-${userMenu.imageConfig!''}"><span class="overlay-label red"></span>
            </i>${userMenu.menuName!''}<b class="fa fa-angle-left dropdown-arrow"></b></a>
                <#if userMenu.childrenMenuList?size gt 0>
                <ul class="dropdown-menu">
                </#if>
                <#list userMenu.childrenMenuList as childMenu>
                    <#if childMenu.isSelected>
                        <li class="active"><a onclick="saveRegister('${childMenu.menuName!''}','2');return true;"
                                              href="${absoluteContextPath}${childMenu.menuUrl!''}"
                                              title="${childMenu.menuName!''}"> <i
                                class="fa fa-${childMenu.imageConfig!''}"><span
                                class="overlay-label red60"></span></i>${childMenu.menuName!''}</a></li>
                    <#else>
                        <li><a onclick="saveRegister('${childMenu.menuName!''}','2');return true;"
                               href="${absoluteContextPath}${childMenu.menuUrl!''}" title="${childMenu.menuName!''}"> <i
                                class="fa fa-${childMenu.imageConfig!''}"><span
                                class="overlay-label red60"></span></i>${childMenu.menuName!''}</a></li>
                    </#if>
                </#list>
                <#if userMenu.childrenMenuList?size gt 0>
                </ul>
                </#if>
            </li>
        <#else>
            <li class="dropdown">
                <#if userMenu.childrenMenuList?size == 0>
                    <a onclick="saveRegister('${userMenu.menuName!''}','1');return true;"
                       href="${absoluteContextPath}${userMenu.menuUrl!''}" title="${userMenu.menuName!''}"><i
                            class="fa fa-${userMenu.imageConfig!''}"> <span
                            class="overlay-label red"></span></i>${userMenu.menuName!''}
                    </a>
                <#else>
                    <a onclick="saveRegister('${userMenu.menuName!''}','1');return true;" href="${absoluteContextPath}"
                       class="dropdown-toggle" data-toggle="dropdown" title="${userMenu.menuName!''}"><i
                            class="fa fa-${userMenu.imageConfig!''}"> <span class="overlay-label red"></span>
                    </i>${userMenu.menuName!''}<b class="fa fa-angle-left dropdown-arrow"></b>
                    </a>
                </#if>
                <#if userMenu.childrenMenuList?size gt 0>
                <ul class="dropdown-menu">
                </#if>
                <#list userMenu.childrenMenuList as childMenu>
                    <#if childMenu.isSelected>
                        <li class="active"><a onclick="saveRegister('${childMenu.menuName!''}','2');return true;"
                                              href="${absoluteContextPath}${childMenu.menuUrl!''}"
                                              title="${childMenu.menuName!''}"> <i
                                class="fa fa-${childMenu.imageConfig!''}"><span
                                class="overlay-label red60"></span></i>${childMenu.menuName!''}</a></li>
                    <#else>
                        <li><a onclick="saveRegister('${childMenu.menuName!''}','2');return true;"
                               href="${absoluteContextPath}${childMenu.menuUrl!''}" title="${childMenu.menuName!''}"> <i
                                class="fa fa-${childMenu.imageConfig!''}"><span
                                class="overlay-label red60"></span></i>${childMenu.menuName!''}</a></li>
                    </#if>
                </#list>
                <#if userMenu.childrenMenuList?size gt 0>
                </ul>
                </#if>
            </li>
        </#if>
    </#list>
</#if>
    <div class="text-right collapse-button" style="padding:7px 9px;">
        <div class="sidebar-collapse"><a href="#"> <i class="fa fa-bars"></i>
        </a></div>
    </div>
</ul>
<!-- Sidebar end -->

<script type="text/javascript">
    function saveRegister(menuName, level) {
        var data = {};
        data.menuName = menuName;
        data.level = level;
        var url = '${absoluteContextPath}/system/register/save';
        $.ajax({
            url: url,
            type: 'post',
            data: data,
            success: function (data) {
                var data = JSON.parse(data);

            }
        });
    }
</script>